//
//  DetailViewController.h
//  SplitForce
//
//  Created by Dave Carroll on 6/20/10.
//  Copyright Salesforce.com 2010. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SplitForceAppDelegate.h"
#import "ZKDescribeLayout.h"
#import "DetailTable.h"
#import "DetailTableEdit.h"
#import "RelatedListTable.h"

@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate, ForceClientDelegate> {
    
    UIPopoverController *popoverController;
    UIToolbar *toolbar;
    
    ZKSObject *detailItem;
    UILabel *detailDescriptionLabel;
	
	UIView *editView;
	
	UILabel *lblAccountName;
	UILabel *lblStreet;
	UILabel *lblCity;
	UILabel *lblZip;
	UILabel *lblState;
	UILabel *lblCountry;
	
	UITextField *txtAccountName;
	UITextField *txtStreet;
	UITextField *txtCity;
	UITextField *txtZip;
	UITextField *txtState;
	UITextField *txtCountry;
	
	//ZKDescribeLayout *layout; // the one layout we will use
	DetailTable *layoutTable;
	RelatedListTable *relatedTable;
	UIView *detailLayoutView;
	DetailTableEdit	*editTable;
}

@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;

@property (nonatomic, retain) id detailItem;
@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel;

@property (nonatomic, retain) IBOutlet UIView *editView;
@property (nonatomic, retain) IBOutlet DetailTableEdit *editTable;
@property (nonatomic, retain) IBOutlet UIView *detailLayoutView;

@property (nonatomic, retain) IBOutlet UILabel *lblAccountName;
@property (nonatomic, retain) IBOutlet UILabel *lblStreet;
@property (nonatomic, retain) IBOutlet UILabel *lblCity;
@property (nonatomic, retain) IBOutlet UILabel *lblZip;
@property (nonatomic, retain) IBOutlet UILabel *lblState;
@property (nonatomic, retain) IBOutlet UILabel *lblCountry;

@property (nonatomic, retain) IBOutlet UITextField *txtAccountName;
@property (nonatomic, retain) IBOutlet UITextField *txtStreet;
@property (nonatomic, retain) IBOutlet UITextField *txtCity;
@property (nonatomic, retain) IBOutlet UITextField *txtZip;
@property (nonatomic, retain) IBOutlet UITextField *txtState;
@property (nonatomic, retain) IBOutlet UITextField *txtCountry;

//@property (nonatomic, retain) ZKDescribeLayout *layout;
@property (nonatomic, retain) DetailTable *layoutTable;
@property (nonatomic, retain) RelatedListTable *relatedTable;

/*
-(IBAction)showEditView:(id)sender;
-(IBAction)hideEditView:(id)sender;
-(IBAction)saveData:(id)sender;
*/
- (void)setDetailItem:(id)newDetailItem ;

-(void)addSubViews;

@end
